home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Sample Code / MacCalendar 1.0d5 / Src / ControlStrip.h next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  5.4 KB  |  153 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ControlStrip.h
  3.  
  4.     Contains:    header file describing the interface between the Control Strip and its modules
  5.  
  6.     Copyright:    © 1992-1994 by Apple Computer, Inc.  All rights reserved.
  7. */
  8.  
  9.  
  10. #ifndef    __CONTROLSTRIP__
  11. #define    __CONTROLSTRIP__
  12.  
  13. #ifndef __TYPES__
  14. #include <Types.h>
  15. #endif
  16.  
  17. #ifndef __MENUS__
  18. #include <Menus.h>
  19. #endif
  20.  
  21. #ifndef __DIALOGS__
  22. #include <Dialogs.h>
  23. #endif
  24.  
  25.  
  26. /*********************************************************************************************
  27.  
  28.     messages passed to the modules
  29.  
  30. *********************************************************************************************/
  31.  
  32. #define    sdevInitModule                    0            // initialize the module
  33. #define    sdevCloseModule                    1            // clean up before being closed
  34. #define    sdevFeatures                    2            // return feature bits
  35. #define    sdevGetDisplayWidth                3            // returns the width of the module's display
  36. #define    sdevPeriodicTickle                4            // periodic tickle when nothing else is happening
  37. #define    sdevDrawStatus                    5            // update the interface in the Control Strip
  38. #define    sdevMouseClick                    6            // user clicked on the module's display area in the Control Strip
  39. #define    sdevSaveSettings                7            // saved any changed settings in module's preferences file
  40. #define    sdevShowBalloonHelp                8            // puts up a help balloon, if the module has one to display
  41.  
  42.  
  43. /*********************************************************************************************
  44.  
  45.     Features supported by the module.  If a bit is set, it means that feature is supported.
  46.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  47.  
  48. *********************************************************************************************/
  49.  
  50. #define    sdevWantMouseClicks                0            // notify the module of mouseDown events
  51. #define    sdevDontAutoTrack                1            // call the module to do mouse tracking
  52. #define    sdevHasCustomHelp                2            // module provides its own help messages
  53. #define    sdevKeepModuleLocked            3            // module needs to be locked in the heap
  54.  
  55.  
  56. /*********************************************************************************************
  57.  
  58.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  59.     If a bit is set, the module can request that a specific function is performed by
  60.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  61.     for future use by Apple, and should be set to zero.
  62.  
  63. *********************************************************************************************/
  64.  
  65. #define    sdevResizeDisplay                0            // resize the module's display
  66. #define    sdevNeedToSave                    1            // need to save changed settings, when convenient
  67. #define    sdevHelpStateChange                2            // need to update the help message because of a state change
  68. #define    sdevCloseNow                    3            // close a module because it doesn't want to stay around
  69.  
  70.  
  71. /*********************************************************************************************
  72.  
  73.     Gestalt
  74.  
  75. *********************************************************************************************/
  76.  
  77. #define    gestaltControlStripAttr            'sdev'        // Control Strip attributes
  78. #define    gestaltControlStripExists        0
  79. #define    gestaltControlStripVersionFixed    1
  80.  
  81.  
  82. #define    gestaltControlStripVersion        'csvr'        // Control Strip version
  83.  
  84.  
  85. /*********************************************************************************************
  86.  
  87.     miscellaneous
  88.  
  89. *********************************************************************************************/
  90.  
  91. #define    sdevFileType                    'sdev'        // module's file type
  92.  
  93. #define    sdevMenuItemMark                '•'            // ‘checkmark’ to use in popup menus
  94.  
  95.  
  96. //    direction values for SBDrawBarGraph
  97.  
  98. #define    BarGraphSlopeLeft                -1            // max end of sloping bar graph is on the left
  99. #define    BarGraphFlatRight                0            // max end of flat bar graph is on the right
  100. #define    BarGraphSlopeRight                1            // max end of sloping bar graph is on the right
  101.  
  102.  
  103. /*********************************************************************************************
  104.  
  105.     utility routines to provide standard interface elements and support for common functions
  106.  
  107. *********************************************************************************************/
  108.  
  109. pascal Boolean SBIsControlStripVisible()
  110.     = {0x7000,0xAAF2};
  111.  
  112. pascal void SBShowHideControlStrip(Boolean showIt)
  113.     = {0x303C,0x0101,0xAAF2};
  114.  
  115. pascal Boolean SBSafeToAccessStartupDisk()
  116.     = {0x7002,0xAAF2};
  117.  
  118. pascal short SBOpenModuleResourceFile(OSType fileCreator)
  119.     = {0x303C,0x0203,0xAAF2};
  120.  
  121. pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  122.     = {0x303C,0x0404,0xAAF2};
  123.  
  124. pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  125.     = {0x303C,0x0405,0xAAF2};
  126.  
  127. pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  128.     = {0x303C,0x0506,0xAAF2};
  129.  
  130. pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  131.     = {0x303C,0x0507,0xAAF2};
  132.  
  133. pascal OSErr SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  134.     = {0x303C,0x0408,0xAAF2};
  135.  
  136. pascal OSErr SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  137.     = {0x303C,0x0409,0xAAF2};
  138.  
  139. pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  140.     = {0x303C,0x040A,0xAAF2};
  141.  
  142. pascal short SBGetBarGraphWidth(short barCount)
  143.     = {0x303C,0x010B,0xAAF2};
  144.  
  145. pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  146.     = {0x303C,0x050C,0xAAF2};
  147.  
  148. pascal void SBModalDialogInContext(ModalFilterProcPtr filterProc, short *itemHit)
  149.     = {0x303C,0x040D,0xAAF2};
  150.  
  151.  
  152. #endif
  153.